package com.zhang.genericdemo.controller;

import com.zhang.genericdemo.request.impl.RequestA;
import com.zhang.genericdemo.request.impl.RequestB;
import com.zhang.genericdemo.response.impl.ResponseA;
import com.zhang.genericdemo.response.impl.ResponseB;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: ZhangGongMing
 * @CreateTime: 2025/4/25 09:31
 * @Description:
 * @Version: 1.0
 */

@Slf4j
@RestController
@RequestMapping("/request/api/v1")
public class RequestController {

    @GetMapping(value = "/getOne")
    public ResponseA getOne(RequestA request) {
        System.out.println("age:" + request.getAge());
        System.out.println("name:" + request.getName());

        ResponseA response = new ResponseA();
        response.setValue("getOne 方法");
        return response;
    }

    @GetMapping(value = "/getTwo")
    public ResponseB getTwo(RequestB request) {
        System.out.println("address:" + request.getAddress());
        System.out.println("phone:{}" + request.getPhone());

        ResponseB response = new ResponseB();
        response.setValue("getTwo 方法");
        return response;
    }
}
